<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
<div id="gauge_cpu" style="width: 500px;height:300px;float:left"></div>
<script src="/javascripts/echarts-all-3.js"></script>
<script type="text/javascript">
// 基于准备好的dom，初始化echarts实例
var myChart4_cpu = echarts.init(document.getElementById('gauge_cpu'));

// 指定图表的配置项和数据
option4_cpu = {
    tooltip : {
        formatter: "{a} <br/>{b} : {c}%"
    },
    toolbox: {
        feature: {
            // restore: {},
            saveAsImage: {}
        }
    },
    series: [
        {
            name: '业务指标',
            type: 'gauge',
            detail: {formatter:'{value}%'},
            data: [{value: 50, name: 'CPU利用率'}]
        }
    ]
};

setInterval(function (){
    var dataObj = JSON.parse(sessionStorage.getItem("oneResult"));
    option4_cpu.series[0].data[0].value = parseInt(dataObj.vm_cpu)
    myChart4_cpu.setOption(option4_cpu);
}, 1000);

</script>